﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace SGArchiveSystem7x.Controllers.SysPZ
{
    public class SysPZController : BaseController
    {
        private string sControllerName = "SysPZ";
        // GET: SysPZ
        public ActionResult Index()
        {
            var n = this.VaildUser(sControllerName);
            if (n != null)
                return n;
            ViewBag.DAY = "";
            ViewBag.STATUS = "";
            var list = SGArchiveSystem7xDB.Linq.T_SyspzDal.Get_SysPZ();
            if (list!=null)
            {
                ViewBag.DAY = list[1].PZ_VALUE;
                ViewBag.STATUS = list[0].PZ_VALUE;
            }
            return View();
        }
        public int PZ(string value1,string value2)
        {
            SGArchiveSystem7xDB.T_SysPZ en = new SGArchiveSystem7xDB.T_SysPZ();
            en.PZ_TYPE = "Email";
            en.PZ_VALUE = value1;
            SGArchiveSystem7xDB.Linq.T_SyspzDal.Modify_SysPZ(en);
            SGArchiveSystem7xDB.T_SysPZ en1 = new SGArchiveSystem7xDB.T_SysPZ();
            en1.PZ_TYPE = "PWD";
            en1.PZ_VALUE = value2;
            SGArchiveSystem7xDB.Linq.T_SyspzDal.Modify_SysPZ(en1);
            return 1;
        }
    }
}